import {
	createRouter,
	createWebHistory
} from 'vue-router'
import Login from '../views/Login.vue'
import AttendManageRouters from './AttendManageRoutes.js'
import ContractManageRouters from './ContractManageRoutes.js'
import FeeManageRouters from './FeeManageRoutes.js'
import PeopleManageRouters from './PeopleManageRoutes.js'
import ProjectManageRouters from './ProjectManageRoutes.js'
import StepManageRouters from './StepManageRoutes.js'

const MainPageRouters=[
	{
		path: '/main',
		name: 'main',
		component: () => import('../views/Main.vue'),
		children: [
			{
				path: '/content',
				name: 'content',
				component: () => import('../views/main/MainContent.vue')
			}
		]
	}
]

MainPageRouters[0].children.push(...AttendManageRouters,
...ContractManageRouters,
...FeeManageRouters,
...PeopleManageRouters,
...ProjectManageRouters,
...StepManageRouters)

const routes = [
	{
		path: '/',
		name: 'login',
		component: () => import('../views/Login.vue')
	}
]

routes.push(...MainPageRouters)

const router = createRouter({
	history: createWebHistory(process.env.BASE_URL),
	routes
})

export default router
